package com.mnyc.http;

import com.mnyc.model.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
//为了能看清楚自动创建对象和SpringBoot创建对象的区别，因此这个地方需要设置url
//这样Feign就不会去创建负载均衡的底层调用对象，然后就和自己自定url的对象基本相同了
@FeignClient(name = "feign", url = "http://localhost:8080/server")
public interface FeignServerrClient {
    @GetMapping("/get")
    String getMethod(@RequestParam(value = "name", required = true) String name);

    @PostMapping("/post")
    String postMethod(@RequestParam("remark") String remark, User user);

    @PutMapping("/put")
    String putMethod(@RequestParam("remark") String remark, User user);

    @DeleteMapping("/delete")
    String deleteMethod(@RequestParam("remark") String remark);

    @PostMapping("/path/{remark}")
    String pathMethod(@PathVariable("remark") String remark, User user);
}
